<?php
/**
 * Block class
 * @author kinson<kinsoncn@gmail.com>
 */
abstract class Lin_Template_Block
{
	public function __construct($tpl = '')
	{
		$this->template($tpl);
		
	}
	
	public function template($tpl)
	{
		if (strstr($tpl, 'Modules_') || strstr($tpl, '_Block_'))
		{
			$tmp = explode('_', $tpl);
			array_shift($tmp);
			$tpl = '/' . implode('/', $tmp) . '.phtml';
		}
		
		$tpl = APPLICATION_PATH . "/design/" . DEFAULT_THEME . "{$tpl}";
		if (!file_exists($tpl))
		{
			die("<p>Block template file[$tpl] don't exist. </p>");
		}
		include $tpl;
	}
	
}